# Forms for the application
# Note that Google AppEngine data model is no compatible with Django 1.1 forms
#   so binding a form to a model is not allowed, thus the following forms

from django import forms
from google.appengine.ext.db import djangoforms
from .models import PromoCode, Trip, TripSpot, TripOrder, TripSignupInfo

class TripForm(djangoforms.ModelForm):
    id = forms.IntegerField(required=False, widget=forms.HiddenInput())
    class Meta:
        model = Trip

class TripSpotForm(djangoforms.ModelForm):
    date_created = forms.DateField(widget=forms.DateInput())
    class Meta:
        model = TripSpot
	fields = ['date_created', 'room', 'is_waiver', 'is_paid']

CHOICES_PAYMENT_METHOD = [
    ('', '---------'), 
    ('paypal', 'Credit Card'), 
    ('paypal', 'Paypal'), 
    ('check', 'Send a Check'),
]

class TripSignupForm(djangoforms.ModelForm):
    billing_first_name  = forms.CharField(required=True, label='Billing First Name')
    billing_last_name  = forms.CharField(required=True, label='Billing Last Name')
    billing_email = forms.EmailField(required=True, label='Billing Email')
    pay_method    = forms.ChoiceField(required=True, label='Payment Method', choices=CHOICES_PAYMENT_METHOD)
    class Meta:
        model = TripSignupInfo
        exclude = ['is_paid', 'is_waiver', 'room', 'trip_order', 'trip_number', 'ski_season', 'date_created']
